package com.lifeverse.event;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.HashMap;

/**
 * 生命体互动事件
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class LifeEntityInteractionEvent extends LifeEntityEvent {
    
    /**
     * 互动类型
     */
    private InteractionType interactionType;
    
    /**
     * 关系ID
     */
    private Long relationshipId;
    
    /**
     * 互动强度
     */
    private Double interactionStrength;
    
    /**
     * 互动结果
     */
    private InteractionResult result;
    
    public LifeEntityInteractionEvent() {
        super();
        setEventType("LIFE_ENTITY_INTERACTION");
        setEventData(new HashMap<>());
    }
    
    public LifeEntityInteractionEvent(Long sourceEntityId, Long targetEntityId, 
                                    InteractionType interactionType) {
        this();
        setSourceEntityId(sourceEntityId);
        setTargetEntityId(targetEntityId);
        this.interactionType = interactionType;
    }
    
    /**
     * 互动类型枚举
     */
    public enum InteractionType {
        COMMUNICATION("通信"),
        COLLABORATION("协作"),
        COMPETITION("竞争"),
        KNOWLEDGE_SHARING("知识分享"),
        RESOURCE_EXCHANGE("资源交换"),
        DECISION_MAKING("决策制定"),
        CONFLICT_RESOLUTION("冲突解决"),
        LEARNING("学习"),
        INNOVATION("创新"),
        SUPPORT("支持");
        
        private final String displayName;
        
        InteractionType(String displayName) {
            this.displayName = displayName;
        }
        
        public String getDisplayName() {
            return displayName;
        }
    }
    
    /**
     * 互动结果枚举
     */
    public enum InteractionResult {
        SUCCESS("成功"),
        PARTIAL_SUCCESS("部分成功"),
        FAILURE("失败"),
        PENDING("待处理"),
        CANCELLED("已取消");
        
        private final String displayName;
        
        InteractionResult(String displayName) {
            this.displayName = displayName;
        }
        
        public String getDisplayName() {
            return displayName;
        }
    }
}